
<div class="btn-group"><a href="<?php echo site_urlc('app/index');?>" class="btn"> <i class="fa fa-arrow-left"></i> <?php echo lang('back_list')?> </a></div>

<?php include_once 'inc_form_errors.php'; ?>

<div class="boxed">
    <h3> <i class="fa fa-pencil"></i> <?php echo lang('edit') ?> <span class="badge badge-success pull-right"><?php echo $title; ?></span></h3>
    <?php echo form_open(current_urlc(), array('class' => 'form-horizontal', 'id' => 'frm-edit')); ?>

    <div class="boxed-inner seamless">

        <div class="control-group">
            <label for="version" class="control-label">版本号:</label>
            <div class="controls">
                <input type="text" name="version" id="version" value="<?php echo set_value('version',$it['version']); ?>"  class='span7'>
                <span class="help-inline"></span>
            </div>
        </div>

        <!-- ctype -->
        <?php if ($ctype = list_coltypes($this->cid)) { ?>
            <div class="control-group">
                <label class="control-label" for="status"> 所属分类:</label>
                <div class="controls">
                    <?php
                    echo ui_btn_select('ctype',set_value("ctype",$it['ctype']),$ctype);
                    ?>
                    <span class="help-inline"></span>
                </div>
            </div>
        <?php } ?>
        <div class="control-group">
            <label for="url" class="control-label">下载地址:</label>
            <div class="controls">
                <input type="text" name="url" id="url" value="<?php echo set_value('url',$it['url']); ?>"  class='span7'>
                <span class="help-inline"></span>
            </div>
        </div>
        <!-- 图片上传 -->
        <div class="control-group">
            <label for="img" class="control-label">版本文件：</label>
            <div class="controls">
                <div class="btn-group">
					<span class="btn btn-success">
						<i class="fa fa-upload"></i>
						<span> <?php echo lang('upload_file') ?>  </span>
						<input class="fileupload" type="file" accept="" data-for="files"  >
					</span>
                    <input type="hidden" name="files" class="form-upload" data-more="0" value="<?php echo set_value('files',$it['files']) ?>">
                </div>
            </div>
        </div>
        <div id="js-files-show" class="js-img-list-f">
        </div>
        <div class="clear"></div>

    </div>
    <div class="boxed-footer">
        <?php if ($this->ccid): ?>
            <input type="hidden" name="ccid" value="<?php echo $this->ccid ?>">
        <?php endif ?>
        <input type="hidden" name="cid" value="<?php echo $this->cid ?>">
        <input type="hidden" name="id" value="<?php echo $it['id']?>">
        <input type="submit" value="<?php echo lang('submit') ?>" class="btn btn-primary">
        <input type="reset" value="<?php echo lang('reset') ?>" class="btn btn-danger">
    </div>
</form>
</div>

<?php include_once 'inc_ui_media.php'; ?>
<script type="text/javascript">
    require(['jquery','adminer/js/ui','adminer/js/media'],function($,ui,media){
        var articles_files = <?php echo json_encode(one_upload($it['files'])) ?>;
        media.init();
        media.show(articles_files,"files");
    });
</script>
